package com.tedu.egnotice1.base.response;

import lombok.*;

@Setter
@Getter
@AllArgsConstructor
@NoArgsConstructor
public class Result {
    private Integer state;
    private String message;
    private Object data;
    public Result(State state){
        this.state = state.getState();
        this.message = state.getMessage();
    }
    public Result(State state,Object data){
        this.state = state.getState();
        this.message = state.getMessage();
        this.data = data;
    }
    public static Result ok(Object data){
        return new Result(State.OPERATION_SUCCESS,data);
    }
    public static Result ok(){
        return Result.ok(null);
    }
}
